home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
QRZ! Ham Radio 1
/
QRZ Ham Radio Callsign Database - December 1993.iso
/
unix
/
token.c
< prev
next >
Wrap
C/C++ Source or Header
|
1993-11-02
|
434b
|
33 lines
/*
** token.c
**
** tokenizes an input string, returning number of
** tokens found.
*/
#include "cb.h"
tokenize(str,list,llen)
char *str;
char *list[];
int llen;
{
int i;
int count = 0;
for (i=0;i<llen;i++)
list[i] = NULL;
if (!strlen(str))
return(0);
if ((list[count] = strtok(str, " ")) != NULL)
{
count++;
while ((count < llen) &&
((list[count] = strtok(NULL," ")) != NULL))
count++;
}
return(count);
}